package com.hdax.dm.api.item.controller;

import com.hdax.dm.api.item.ItemTypeControllerApi;
import com.hdax.dm.entity.item.ItemType;
import com.hdax.dm.service.ItemTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component          //表示将此类标记为Spring容器中的一个Bean
public class ItemTypeController implements ItemTypeControllerApi {

    @Autowired
    private ItemTypeService itemTypeService;

    @Override
    public List<ItemType> types(Long parent) {
        return itemTypeService.levelOne(parent);
    }

    @Override
    public List<ItemType> lineNav() {
        return itemTypeService.lineNav();
    }

    @Override
    public List<ItemType> floor() {
        return itemTypeService.floor();
    }
}
